// Copyright (C) CompatibL Technologies LLC. All rights reserved.
// This code contains valuable trade secrets and may be used, copied,
// stored, or distributed only in accordance with a written license
// agreement and with the inclusion of this copyright notice. 

#region File Info
// File       : ScaleNote.cs
// Description: ChordCreator.ScaleNote component implementation.
// Package    : ChordCreator
//
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChordCreator.Services.ConfigurationServices;

namespace ChordCreator.Model
{
    /// <summary>
    /// Summary description for ScaleNote.
    /// </summary>
    class ScaleNote
    {
        private int degree_;
        private Note note_;

        public int Degree
        {
            get { return degree_; }
        }

        public Note Note
        { get {return note_;}}
        /// <summary>
        /// Initializes a new instance of the <see cref="ScaleNote"/> class.
        /// </summary>
        public ScaleNote(int degree, Note note)
        {
            note_ = note;
            degree_ = degree;
        }
        public override string ToString()
        {
            string degreeAsRome = ConvertToRome();

            return string.Format("{0} - {1}", degreeAsRome, CurrentConfiguration.Instance.GetNotePresentation(note_));
        }

        private string ConvertToRome()
        {
            switch (degree_)
            {
                case 1: return "1";
                case 2: return "2";
                case 3: return "3";
                case 4: return "4";
                case 5: return "5";
                case 6: return "6";
                case 7: return "7";
                case 8: return "8";
                case 9: return "9";
                case 10: return "10";
                case 11: return "11";
                case 12: return "12";
            }
            return "error";
        }
    }
}